package com.sumainfor.pc.dev.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.dev.service.CouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 优惠券
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-03-29 10:59
 **/
@Controller
@RequestMapping("/tenant/kty/CouponController")
public class CouponController {

    @Autowired
    CouponService couponService;
    /**
    * <p>
    * 根据优惠券编码获取优惠券的信息11
    * </p>
    *
    * @author: zhoucong
    * @since: 2019-03-29
    */
    @ResponseBody
    @PostMapping("/getCouponByCouId")
    public JsonResult getCouponByCouId(@RequestParam Map<String,Object> params){
        return couponService.getCouponByCouId(params);
}

    @ResponseBody
    @PostMapping("/updateCouponStatus")
    public JsonResult updateCouponStatus(@RequestParam Map<String,Object> params){
        System.out.println("assddd"+params);
        return couponService.updateCouponStatus(params);
    }
}
